package threadDemo;

/**
 * 匿名内部类形式完成两种线程的创建方式.
 */
public class ThreadDemo3 {
    public static void main(String[] args) {
        Thread t1 = new Thread() {
            public void run() {
                for (int i = 0; i < 1000; i++) {
                    System.out.println("精准雨落!");
                }
            }
        };
        Runnable r1 = () -> {
            for (int i = 0; i < 1000; i++) {
                System.out.println("我有两把枪一个叫s,一个叫a!");
            }

        };
        Thread r2 = new Thread(r1);

        t1.start();
        r2.start();
    }
}
